package com.hankol.newretail.utils;

import android.app.Activity;

import com.baselibrary.manager.SensorsDataManager;
import com.baselibrary.utils.ARouterUtils;
import com.baselibrary.view.banner.listener.OnBannerListener;

import java.util.List;

/**
 * @author 关忆北丶
 * @description:
 * @date :2021/7/15 10:41
 */
public class IpOnBannerListener implements OnBannerListener {
    private List<String> titleList;
    private List<String> nameList;
    private Activity activity;
    private int pos;// -1 商城顶部 0：商城推荐

    public IpOnBannerListener(Activity activity, List<String> data, List<String> nameList, int pos) {
        this.titleList = data;
        this.nameList = nameList;
        this.activity = activity;
        this.pos = pos;
    }

    @Override
    public void OnBannerClick(int position) {
        String routeUrl = titleList.get(position);
        if (pos ==-1) {
            SensorsDataManager.Companion.getInstance().shopBannerClick();
        }
        if (pos == 0) {
           SensorsDataManager.Companion.getInstance().shopAdClick(nameList.get(position),"推荐广告");
        }
        ARouterUtils.jump(routeUrl);
    }
}
